#ifndef CAMERA_ABSTRACTOR_H_
#define CAMERA_ABSTRACTOR_H_

#include <pylon/PylonIncludes.h>
using namespace Pylon;

#include <pylon/gige/BaslerGigECamera.h>
typedef Pylon::CBaslerGigECamera Camera_t;
using namespace Basler_GigECameraParams;
using namespace Basler_GigEStreamParams;

#include <stdlib.h>
#include <stddef.h>

using namespace std;

class CameraAbstractor {
private:
  Pylon::PylonAutoInitTerm auto_init_term; //TODO: será que funciona na inicialização do objeto?
  Pylon::CBaslerGigECamera *camera; //A câmera...
  int64_t image_width;
  int64_t image_height;
  Pylon::CBaslerGigECamera::StreamGrabber_t *stream_grabber; //Stream grabber para capturar imagens
  StreamBufferHandle hbuffer;
  uint8_t * pbuffer;
  bool initialized;
  string error_message;

public:
  CameraAbstractor();

  void Initialize();

  void Finalize();

  bool IsInitialized();

  bool GetImage(uint32_t** area_to_put_image);

  int64_t GetConfiguredImagesWidth();

  int64_t GetConfiguredImagesHeight();

  string GetErrorMessage();
};

#endif
